<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }
    
    #id {
        width: 200px;
        height: 200px;
        border-bottom: 1px solid #000;
    }
</style>

<body>
    <div id="id"></div>
</body>
<!-- <script>
    window.onload = function() {
        var dpr = window.devicePixelRatio;
        // 这是缩放比例
        var scale = 1 / dpr
        var width = document.documentElement.clientWidth;
        // 获取meta标签
        var metaNode = document.querySelector('meta[name="viewport"]')
        metaNode.setAttribute('content', 'width=device-width, initial-scale=' + scale + ' ')
        var htmlNode = document.querySelector('html');
        htmlNode.style.fontSize = width * dpr + 'px'
    }
</script> -->

</html>